<template>
  <el-pagination @current-change="changePage"
                 @size-change="changeSize"
                 :current-page=msg.page :total=msg.total :page-size=msg.size :page-sizes="[20,]"
                 layout="sizes,total, prev, pager, next, jumper"
                 class="table-page">
  </el-pagination>
</template>

<script>
  export default {
    props: ['msg'],
    methods: {
      changePage(currentPage) {
        let that = this;
        document.getElementsByClassName('index-content-warp')[0].scrollTop = 0;
        that.$emit('changePage', currentPage)
      },
      changeSize(currentSize) {
        let that = this;
        document.getElementsByClassName('index-content-warp')[0].scrollTop = 0;
        that.$emit('changeSize', currentSize)
      }
    }
  }
</script>

<style lang="less">
  //自定义分页样式
  .table-page {
    margin: 20px 0;
    text-align: center;
  }
</style>
